]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: handle touch events during grab modality
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 24 Jul 2014 16:31:51 +0000 (18:31 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Jul 2014 08:55:25 +0000 (10:55 +0200)
The "pointer emulating" touch sequence will be handled in order to dismiss
the grab, while the others are just propagated.

https://bugzilla.gnome.org/show_bug.cgi?id=733633

js/ui/grabHelper.js

index c5f76c8cf82defd83cd99c6ebf1c8ac669e4dda9..4474e49211eebd24c3004043889245c960830f65 100644 (file)
@@ -288,8 +288,16 @@ const GrabHelper = new Lang.Class({
         let release = type == Clutter.EventType.BUTTON_RELEASE;
         let button = press || release;
 
-        if (this._ignoreUntilRelease && (motion || release)) {
-            if (release)
+        let touchUpdate = type == Clutter.EventType.TOUCH_UPDATE;
+        let touchBegin = type == Clutter.EventType.TOUCH_BEGIN;
+        let touchEnd = type == Clutter.EventType.TOUCH_END;
+        let touch = touchUpdate || touchBegin || touchEnd;
+
+        if (touch && !global.display.is_pointer_emulating_sequence (event.get_event_sequence()))
+            return Clutter.EVENT_PROPAGATE;
+
+        if (this._ignoreUntilRelease && (motion || release || touch)) {
+            if (release || touchEnd)
                 this._ignoreUntilRelease = false;
             return Clutter.EVENT_STOP;
         }
@@ -300,10 +308,10 @@ const GrabHelper = new Lang.Class({
         if (Main.keyboard.shouldTakeEvent(event))
             return Clutter.EVENT_PROPAGATE;
 
-        if (button) {
+        if (button || touchBegin) {
             // If we have a press event, ignore the next
             // motion/release events.
-            if (press)
+            if (press || touchBegin)
                 this._ignoreUntilRelease = true;
 
             let i = this._actorInGrabStack(event.get_source()) + 1;